package com.example.teesystem.entityDto;

import com.example.teesystem.common.utils.FileUtil;
import com.example.teesystem.common.utils.TimeUtil;
import com.example.teesystem.entity.User;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.beans.BeanUtils;

/**
 * @author pxr
 * @data 26/11/2022 下午1:21
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class UserPlayer {
    private String username;

    /**
     * 性别
     */
    private String gender;

    /**
     * 生日
     */
    private String birthday;

    /**
     * 姓名
     */
    private String myName;
    private String avatarUrl;

    public UserPlayer(User user){
        BeanUtils.copyProperties(user,this);
        if(user.getAvatarUrl()!=null && !user.getAvatarUrl().equals("")){
            this.avatarUrl = FileUtil.FILE_PREFIX + user.getAvatarUrl();
        }
    }
}
